package com.booter.proxy.config;

import com.booter.webflux.http.factory.HttpBeanDefinitionRegistry;
import com.booter.webflux.http.processor.CreateProcessor;
import com.booter.webflux.http.processor.ServiceCreateProcessor;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ServiceConfig {

    @Bean
    public CreateProcessor processor() {
        return new ServiceCreateProcessor();
    }

//    @Bean
//    public HttpBeanDefinitionRegistryPostProcessor HttpBeanDefinitionRegistryPostProcessor(@Qualifier("processor") CreaterProcessor processor) {
//        HttpBeanDefinitionRegistryPostProcessor beanDefinition = new HttpBeanDefinitionRegistryPostProcessor("com.booter.proxy.service");
//        beanDefinition.setProcessor(processor);
//        return beanDefinition;
//    }

    @Bean
    public HttpBeanDefinitionRegistry HttpBeanDefinitionRegistryPostProcessor(@Qualifier("processor") CreateProcessor processor) {
        return new HttpBeanDefinitionRegistry("com.booter.proxy.service", processor);
    }
}
